/* 导航栏样式 - 统一所有页面的导航栏外观 */

/* 侧边导航栏布局已在layout.css中定义 */
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  box-shadow: none;  /* 去掉阴影效果 */
}

.sidebar-header {
  padding: 0;
  width: 100%;
  display: none; /* 完全隐藏头像区域，保持一致性 */
  justify-content: center;
}

.user-avatar {
  display: none; /* 头像已移到标题栏，侧边栏不再显示 */
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-nav {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  padding: 56px 0 8px 0;  /* 顶部56px (31+25下移), 底部8px */
  display: flex;
  flex-direction: column;
  gap: 8px;  /* 选项间距8px */
}

.sidebar-footer {
  padding: 8px 0;  /* 恢复原始padding */
  width: 100%;
  /* border-top: 1px solid rgba(0, 0, 0, 0.08); */ /* 已移除横线 */
}

/* 隐藏设置按钮的文字 */
.sidebar-footer .nav-text {
  display: none;
}

/* 去掉设置按钮的交互效果 */
.sidebar-footer .nav-item {
  cursor: default;  /* 去掉手型光标 */
  pointer-events: none;  /* 禁用所有鼠标事件 */
}

/* 放大设置图标1.764倍 (1.4 * 1.26) */
.sidebar-footer .nav-icon {
  width: 31.752px;   /* 25.2px * 1.26 = 31.752px */
  height: 31.752px;
  position: relative;  /* 为状态指示灯定位 */
  margin-top: 14px;  /* 下移14px */
}

/* 服务器连接状态指示灯 */
.server-status-indicator {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12.6px;  /* 10px * 1.26 = 12.6px */
  height: 12.6px;
  border-radius: 50%;
  border: 2.52px solid #fff;  /* 2px * 1.26 = 2.52px */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
  z-index: 1;
}

/* 状态颜色 */
.server-status-indicator.connected {
  background-color: #52c41a;  /* 绿色 - 连接正常 */
}

.server-status-indicator.connecting {
  background-color: #faad14;  /* 黄色 - 正在连接 */
  animation: pulse 1.5s ease-in-out infinite;
}

.server-status-indicator.disconnected {
  background-color: #ff4d4f;  /* 红色 - 连接断开 */
}

/* 连接中的脉冲动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.sidebar-footer .nav-item:hover {
  background: transparent;  /* 去掉hover背景 */
}

.sidebar-footer .nav-item:hover .nav-icon {
  transform: none;  /* 去掉hover缩放动画 */
}

.sidebar-footer .nav-item.active {
  background: transparent;  /* 去掉active背景 */
}

.sidebar-footer .nav-item.active::before {
  display: none;  /* 去掉active指示条 */
}

.sidebar-footer .nav-item.active .nav-icon {
  transform: none;  /* 去掉active缩放 */
}

.sidebar-footer .nav-item.active .nav-icon img {
  filter: none;  /* 去掉active颜色滤镜 */
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 5px;
  margin: 0 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  border-radius: 8px;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.78);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.96);
  position: relative;
}

.nav-item.active::before {
  display: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  transition: all 0.25s ease;
  position: relative;
}

.nav-item:hover .nav-icon {
  transform: scale(1.05);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.25s ease;
}

.nav-item.active .nav-icon img {
  filter: none;
}

.nav-text {
  font-size: 11px;
  color: #666;
  text-align: center;
  white-space: nowrap;
  font-weight: 400;
  transition: all 0.25s ease;
}

.nav-item:hover .nav-text {
  color: #0084F1;
}

.nav-item.active .nav-text {
  color: #0084F1;
  font-weight: 600;
}

/* 通知徽章 */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 11.52px;
  height: 11.52px;
  padding: 0 2.88px;
  background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
  color: white;
  font-size: 7.2px;
  font-weight: 600;
  border-radius: 5.76px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(255, 77, 79, 0.4);
  z-index: 10;
  animation: badgePop 0.3s ease;
}

/* 徽章数量超过99显示省略 */
.notification-badge[data-count="99+"] {
  font-size: 6.48px;
  padding: 0 2.16px;
}

/* 徽章弹出动画 */
@keyframes badgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
